import {INCREMENT,DECREMENT} from './constants'
const initNum = 0;
const store = function (preState = initNum, e) {
  const {type,data}=e
  switch (type) {
    case INCREMENT:
      return preState+data
    case DECREMENT:
      return preState-data
    default:
      return preState
  }
}
export default store

